<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>style对象赋值样式</title>
</head>

<body>
  <div id="root">
    <div :style="{color:'red',fontSize:'50px'}">我是一个标题</div>
    <div :style="styleobj">我是一个标题</div>
  </div>
  <script src="./js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#root',
      data: {
        styleobj:{
          color:'blue',
          fontSize:'80px',
          backgroundColor:"yellow"
        }
      }
    })
  </script>
</body>

</html>